
							*=================================================*
							* Economic Interventions, Evaluations and Trust   *
							* Devine/Turnbull-Dugarte						  *
							*=================================================*
							
													***************
													**  STUDY 2	 **
													***************
							
							
use "/Users/stuartturnbulldugarte/Dropbox/Interventions & Trust/STU/GESIS_eurobarometers.dta", clear




													***************
													**  FIGURE 3 **
													***************

//Controlling unemployment
//Effects of intervention
**indirect
gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (unemp_change -> swd_new, ) (unemp_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:perecon_new]*_b[perecon_new:1.intervention], post
estimates store ame

**total
gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (unemp_change -> swd_new, ) (unemp_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:1.intervention] + _b[swd_new:perecon_new]*_b[perecon_new:1.intervention], post
estimates store ate

**direct
gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (unemp_change -> swd_new, ) (unemp_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:1.intervention], post
estimates store ade

//Effects of unemployment
**indirect
gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (unemp_change -> swd_new, ) (unemp_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:perecon_new]*_b[perecon_new:unemp_change], post
estimates store ame_u

**total
gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (unemp_change -> swd_new, ) (unemp_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:unemp_change] + _b[swd_new:perecon_new]*_b[perecon_new:unemp_change], post
estimates store ate_u

**direct
gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (unemp_change -> swd_new, ) (unemp_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:unemp_change], post
estimates store ade_u

coefplot (ate, label(EU intervention)) (ate_u, label(Δ Unemployment (%)) msymbol(D)) || ame  ame_u || ade ade_u,  keep(_nl_1) vertical yline(0, lcolor(black)) ci(99 95) byopts(row(1)) ylabel(0.2(0.2)-0.6) yscale(range(0.2(0.2)-0.6)) legend(row(1)) mlabel format(%9.2g) mlabposition(2) mlabgap(*2) xlabel("") ytitle("Effect on SWD (1-4)")  bylabels("ATE" "AME" "ADE") scheme(538w) plotregion(lcolor(black)) 
graph save Figure3.gph, replace
graph export Figure3.pdf, replace



													***************
													**  FIGURE 4 **
													***************

///Controlling for Deficit////

**ame
gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (deficit_change -> swd_new, ) (deficit_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:perecon_new]*_b[perecon_new:1.intervention], post
estimates store ame1
*ate
gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (deficit_change -> swd_new, ) (deficit_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:1.intervention] + _b[swd_new:perecon_new]*_b[perecon_new:1.intervention], post
estimates store ate1
**ade
gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (deficit_change -> swd_new, ) (deficit_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:1.intervention], post
estimates store ade1

**ame
gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (deficit_change -> swd_new, ) (deficit_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:perecon_new]*_b[perecon_new:deficit_change], post
estimates store ame1_def
**ate
gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (deficit_change -> swd_new, ) (deficit_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:deficit_change] + _b[swd_new:perecon_new]*_b[perecon_new:deficit_change], post
estimates store ate1_def
**ade
gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (deficit_change -> swd_new, ) (deficit_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:deficit_change], post
estimates store ade1_def


///Controlling for DEBT///
gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (debt_change -> swd_new, ) (debt_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:perecon_new]*_b[perecon_new:1.intervention], post
estimates store ame2
gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (debt_change -> swd_new, ) (debt_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:1.intervention] + _b[swd_new:perecon_new]*_b[perecon_new:1.intervention], post
estimates store ate2
gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (debt_change -> swd_new, ) (debt_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:1.intervention], post
estimates store ade2

gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (debt_change -> swd_new, ) (debt_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:perecon_new]*_b[perecon_new:debt_change], post
estimates store ame2_debt

gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (debt_change -> swd_new, ) (debt_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:debt_change] + _b[swd_new:perecon_new]*_b[perecon_new:debt_change], post
estimates store ate2_debt

gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (debt_change -> swd_new, ) (debt_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:debt_change], post
estimates store ade2_debt


///Controlling for interest rates////
gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (interest_change -> swd_new, ) (interest_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:perecon_new]*_b[perecon_new:1.intervention], post
estimates store ame3

gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (interest_change -> swd_new, ) (interest_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:1.intervention] + _b[swd_new:perecon_new]*_b[perecon_new:1.intervention], post
estimates store ate3

gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (interest_change -> swd_new, ) (interest_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:1.intervention], post
estimates store ade3


gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (interest_change -> swd_new, ) (interest_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:perecon_new]*_b[perecon_new:interest_change], post
estimates store ame3_int

gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (interest_change -> swd_new, ) (interest_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:interest_change] + _b[swd_new:perecon_new]*_b[perecon_new:interest_change], post
estimates store ate3_int


gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (interest_change -> swd_new, ) (interest_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:interest_change], post
estimates store ade3_int

///Controlling for GDP change////
gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (realgdpgr_change -> swd_new, ) (realgdpgr_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:perecon_new]*_b[perecon_new:1.intervention], post
estimates store ame4

gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (realgdpgr_change -> swd_new, ) (realgdpgr_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:1.intervention] + _b[swd_new:perecon_new]*_b[perecon_new:1.intervention], post
estimates store ate4

gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (realgdpgr_change -> swd_new, ) (realgdpgr_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:1.intervention], post
estimates store ade4


gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (realgdpgr_change -> swd_new, ) (realgdpgr_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:perecon_new]*_b[perecon_new:realgdpgr_change], post
estimates store ame4_gdp

gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (realgdpgr_change -> swd_new, ) (realgdpgr_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:realgdpgr_change] + _b[swd_new:perecon_new]*_b[perecon_new:realgdpgr_change], post
estimates store ate4_gdp


gsem (perecon_new -> swd_new, ) (i.intervention -> swd_new, ) (i.intervention -> perecon_new, ) (realgdpgr_change -> swd_new, ) (realgdpgr_change -> perecon_new, )(year -> swd_new, ) (year -> perecon_new, ) (i.cntryID -> swd_new, )  (i.cntryID -> perecon_new, ) if eumember==1, nocapslatent vce(robust)
nlcom _b[swd_new:realgdpgr_change], post
estimates store ade4_gdp


////Plotting all macroeconomic indicators////
coefplot (ate_u, label(Δ Unemployment (%))) (ate1_def, label(Δ budget deficit (% of GDP))) (ate2_debt, label(Δ public debt (% of GDP))) (ate3_int, label(Δ interest rate (%))) || ame_u ame1_def ame2_debt ame3_int  || ade_u ade1_def ade2_debt ade3_int, keep(_nl_1) vertical yline(0, lcolor(black)) ci(99 95) byopts(row(1)) ylabel(0.02(0.02)-0.04) yscale(range(0.02(0.02)-0.04)) legend(row(1)) xlabel("")  ytitle("Effect on SWD (1-4)")  bylabels("ATE" "AME" "ADE") scheme(538bw) plotregion(lcolor(black)) 
graph save Figure4.gph, replace
graph export Figure4.pdf, replace

